<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
App::uses('AppHelper', 'View/Helper');
class CaptchaHelper extends AppHelper {
	public $helpers = array('Form');
  function show($captcha_image_url, $success_captcha = null, $error_captcha = null){
      $html = "<div><img src='". $captcha_image_url . "' id='captcha' alt='CAPTCHA Image' /></div>";
			$html .= "<div style='margin: 15px 0px;'><a href='#' class='reload-captcha' onclick=\" var d = new Date(); var t = d.getTime(); document.getElementById('captcha').src = '" . $this->webroot . "securimage?t=' + t; return false;\">" . __('Reload Image Captcha') . "</a></div>";
      $html .= "<div><input type='text' id='captcha_code' name='data[Captcha][captcha_code]' size='0' maxlength='6' value='' /></div>";
      $html .= "<div style='color:red;'> " .  (isset($error_captcha) ? $error_captcha : '') . "</div> <div style='color:green;'>" . (isset($success_captcha) ? $success_captcha : '') . "</div>";
      return $html;
  }
  
}

?>
